package kr.co.insoft.core.model.callback;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import org.apache.commons.lang.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CallBackDataBodyModel implements Serializable {

	private static final Logger CallBackDataBodyModelLog = LoggerFactory
			.getLogger(CallBackDataBodyModel.class);
	/**
	 * 
	 */
	private static final long serialVersionUID = -3303000621003768216L;
	String eventId;
	String eventChainId;
	String eventName;
	String eventBroadcasting;
	String scriptName;
	String scriptExitCode;
	String eventChainTransactionId;
	String scriptLog;

	public String getEventId() {
		return eventId;
	}

	public void setEventId(String eventId) {
		this.eventId = eventId;
	}

	public String getEventChainId() {
		return eventChainId;
	}

	public void setEventChainId(String eventChainId) {
		this.eventChainId = eventChainId;
	}

	public String getEventName() {
		return eventName;
	}

	public void setEventName(String eventName) {
		this.eventName = eventName;
	}

	public String getEventBroadcasting() {
		return eventBroadcasting;
	}

	public void setEventBroadcasting(String eventBroadcasting) {
		this.eventBroadcasting = eventBroadcasting;
	}

	public String getScriptName() {
		return scriptName;
	}

	public void setScriptName(String scriptName) {
		this.scriptName = scriptName;
	}

	public String getScriptExitCode() {
		return scriptExitCode;
	}

	public void setScriptExitCode(String scriptExitCode) {
		this.scriptExitCode = scriptExitCode;
	}

	public String getEventChainTransactionId() {
		return eventChainTransactionId;
	}

	public void setEventChainTransactionId(String eventChainTransactionId) {
		this.eventChainTransactionId = eventChainTransactionId;
	}

	public String getScriptLog() {
		return scriptLog;
	}

	public void setScriptLog(String scriptLog) {
		try {
			this.scriptLog = StringEscapeUtils.escapeSql(URLDecoder.decode(
					(String) scriptLog, "UTF-8"));
		} catch (UnsupportedEncodingException e) {
			this.scriptLog = scriptLog;
			CallBackDataBodyModelLog
					.warn("((((( Callback Script Not Encoded )))))");
		}
	}
}
